﻿using System;
using Enyim.Caching;
using Ayatta.Contract;
using Web.Core.Extensions;
using Web.Core.Security;
using Web.My.Models;
using System.Web.Mvc;


namespace Web.My.Controllers
{
    /// <summary>
    /// 账户
    /// </summary>
    public class AccountController : BaseController
    {
        public AccountController(Lazy<IInfrastructureService> infrastructure, Lazy<IPassportService> passport, Lazy<IAccountService> account, Lazy<IStoreService> store, Lazy<ITradeService> trade, Lazy<IPlayService> play, Lazy<IMiscService> misc, Lazy<IExtraService> extra, IMemcachedClient memcachedClient)
            : base(infrastructure, passport, account, store, trade, play, misc, extra, memcachedClient)
        {
        }

        /// <summary>
        /// 现金账户明细
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(int page = 1, int size = 50, bool? flow = null, int? group = null, DateTime? beninDate = null, DateTime? endDate = null)
        {
            var identity = User.Identity.Identity();
            var model = new AccountControllerModel.Index();
            model.Account = Account.Value.AccountGet(identity.Id);
            model.Details = Account.Value.AccountDetailMoneyPagedList(page, size, identity.Id, flow, group, beninDate, endDate).ToPagedList(page, size);
            return View(model);
        }

        /// <summary>
        /// 金币账户明细
        /// </summary>
        /// <returns></returns>
        public ActionResult Coin(int page = 1, int size = 50, bool? flow = null, int? group = null, DateTime? beninDate = null, DateTime? endDate = null)
        {

            return View();
        }
    }
}
